var totalTime = 3;

window.onload = function() {
    setInterval("CountDown()", 1000);
    progressBar();
}

// loading
function progressBar() {
    var progress = document.getElementById("progress");
    var width = 1;
    var id = setInterval(frame, 30);

    function frame() {
        if(width >= 100) {
            clearInterval(id);
            progressBar();
        } else {
            width++;
            progress.style.width = width + '%';
        }
    }
}


function CountDown() {
    if(totalTime >= 0) {
        totalTime--;
    }else {
        document.getElementById("loader").className = "loading-content hidden";
        document.getElementById("contents").className = "cd-main-content show";
    }
}
	